package com.jingnen.guess_index_server.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "guess_result")
public class GuessResult {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @Column(name = "guess_record_id", nullable = false)
    private Long guessRecordId;

    @Column(name = "correct_index", nullable = false)
    private Integer correctIndex;

    @Column(name = "is_win", columnDefinition = "TINYINT(1) DEFAULT 0")
    private Integer isWin;
    
    @Column(name = "reward_coin")
    private Integer rewardCoin;

    @Column(name = "reward_cash")
    private BigDecimal rewardCash;

    @Column(name = "result_time")
    private LocalDateTime resultTime;

    @Column(name = "create_time")
    private LocalDateTime createTime;
}
